package com.example.lenovo.demo;

import android.app.ProgressDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;

import com.example.lenovo.demo.presenter.listener.StrategyActivityPresenter;
import com.example.lenovo.demo.view.ifgview.IStrategyActivity;

import org.xutils.view.annotation.ContentView;
import org.xutils.view.annotation.ViewInject;
import org.xutils.x;

@ContentView(R.layout.activity_strategy)
public class StrategyActivity extends AppCompatActivity {
    @ViewInject(R.id.strategyAc_Lv)
    private ListView listView;

    private String id;
    private StrategyActivityPresenter presenter;
    private IStrategyActivity view;
    private ProgressDialog progressDialog;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        x.view().inject(this);
        initView();

    }

    private void initView() {
        presenter=new StrategyActivityPresenter();
        view=presenter;
        id=getIntent().getStringExtra("msg");
        progressDialog=new ProgressDialog(this);
        progressDialog.setTitle("提示");
        progressDialog.setMessage("正在加载...");
        progressDialog.setCancelable(true);
        view.sendView(this,listView,id,progressDialog);
        presenter.initData();
    }
}
